Skip to content

Fix image preview rendering behind game tiles - #30

Merged
makuchpatryk merged 4 commits into
mainfrom
copilot/fix-image-preview-layer
Feb 23, 2026
Merged

Fix image preview rendering behind game tiles#30
makuchpatryk merged 4 commits into
mainfrom
copilot/fix-image-preview-layer

Conversation

Copilot AI commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

The image preview used CSS scale-150 to enlarge on click, which doesn't affect document layout flow — the scaled element rendered behind the puzzle tile grid.

Changes

  • GameView.vue — Replace scale-150 toggle with a <Teleport to="body"> overlay:

    • Fixed-position, z-50 backdrop (bg-black/60 + backdrop-blur) renders above all game content
    • "Preview" glass-pill badge above the image makes context explicit
    • close button (accessible aria-label) + click-backdrop-to-close
    • Smooth fade + scale-down enter/leave via Vue <Transition> with scoped CSS
    • Thumbnail retains hover:scale-105 micro-interaction and tooltip
  • i18n.config.ts — Add Preview and Close preview translation keys

<Teleport to="body">
  <Transition name="preview-overlay">
    <div v-if="enlargePreview" class="fixed inset-0 z-50 ..." @click.self="enlargePreview = false">
      <span aria-hidden="true">{{ $t("Preview") }}</span>
      <img :src="data.imgSrc" class="max-h-[80vh] max-w-[90vw] ..." />
      <button :aria-label="$t('Close preview')" @click="enlargePreview = false">✕</button>
    </div>
  </Transition>
</Teleport>
Original prompt

podglad obrazka w grze wyswietla sie pod gra (kafelekami) mozesz to poprawic i mozesz tez zrobic ux zeby to fajnie dzialalo i bylo wiadomo ze to jest podglad plus moze zeby byla jakas ladna animacja


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel

vercel Bot commented Feb 23, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
perplex-image Ready Ready Preview, Comment Feb 23, 2026 11:11pm

The image preview used CSS scale-150 transform which doesn't affect
document layout flow, causing the enlarged preview to appear behind/below
the game tiles.

- Wrap enlarged preview in <Teleport to="body"> so it always renders
  on top of everything else (z-50, fixed positioning)
- Add semi-transparent dark backdrop with backdrop-blur
- Add "Preview" pill badge (aria-hidden) for clear visual context
- Add accessible close (✕) button with aria-label
- Add smooth fade + scale enter/leave animation via Vue <Transition>
- Thumbnail shows hover:scale-105 and title tooltip
- Clicking backdrop closes the overlay
- Add "Preview" and "Close preview" i18n keys

Co-authored-by: makuchpatryk <19875907+makuchpatryk@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix image preview display under game tiles Fix image preview rendering behind game tiles Feb 23, 2026
Copilot AI requested a review from makuchpatryk February 23, 2026 22:46
@makuchpatryk
makuchpatryk marked this pull request as ready for review February 23, 2026 23:09
@makuchpatryk
makuchpatryk changed the base branch from feat-multi-select to main February 23, 2026 23:09
@makuchpatryk
makuchpatryk merged commit 67469b1 into main Feb 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants